<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>添加</title>
    <link href="../../layuiadmin/js/adm/css/bootstrap.css" rel="stylesheet">
    <script src="../../layuiadmin/js/adm/js/vue.js"></script>
    <script src="../../layuiadmin/js/adm/js/vue-resource.js"></script>
    <script src="../../layuiadmin/js/adm/js/jquery.min.js"></script>
    <script src="../../layuiadmin/js/adm/js/bootstrap.js"></script>
    <script src="../../layuiadmin/js/adm/js/getUrlParam.js"></script>
    <script src="../../layuiadmin/js/adm/js/date.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui@1.4/lib/theme-default/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui@1.4/lib/index.js"></script>
    <script src="../../layuiadmin/js/adm/js/jquery.cookie.js"></script>
   
</head>
<body>
    <div id="app" class="container-fluid" style="margin: 20px 8%" >
         <h4 style="size: 30px;margin-top: 30px"><b>丨基本资料</b></h4>
         <hr>
         <div class="row" style="margin-top: 20px">
             <div class="col-md-6">
                <p><b><span style="color: red">*&nbsp;</span>收件人：</b></p>
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="请选择收件人" v-model="register.empId.empName">
                    <span class="input-group-btn">
                        <button class="btn btn-primary"  data-toggle="modal" data-target="#empmt"  type="button">选择收件人</button>
                    </span>
                </div>    
             </div>
             <div class="col-md-6">
                <p><b><span style="color: red">*&nbsp;</span>收件日期：</b></p>
                <input type="date" v-model="register.receipt" class="form-control">
             </div>
         </div>
         <div class="row" style="margin-top: 20px">
            <div class="col-md-6">
                <p><b><span style="color: red">*&nbsp;</span>快递公司：</b></p>
                <input type="text" class="form-control" placeholder="请选择快递公司"  v-model="register.companyId.companyName"  data-toggle="modal" data-target="#mtacompany"  style="width: 100%">
            </div>
            <div class="col-md-6">
                <p><b><span style="color: red">*&nbsp;</span>快递类型：</b></p>
                <input type="text" class="form-control" placeholder="请选择快件类型"  v-model="register.espressId.espressName"  data-toggle="modal" data-target="#mtespress"  style="width: 100%">
            </div>
        </div>
        <div class="row" style="margin-top: 20px">
            <div class="col-md-6">
                <p><b><span style="color: red">*&nbsp;</span>领件状态：</b></p>
                <select v-model="register.state" class="form-control">
                    <option value="-1">请选择</option>
                    <option value="Y">已领件</option>
                    <option value="N">未领件</option>
                </select>
            </div>
        </div>

        <h4 style="size: 30px;margin-top: 30px"><b>丨其他选填</b> &nbsp;&nbsp; <button type="button" class="btn btn-default btn-xs" @click="opone()">其他</button>  </h4>
        <div id="opone" style="display: none">
        <hr>
            <div class="row" style="margin-top: 20px">
                <div class="col-md-6">
                    <p><b>案件：</b></p>
                    <input type="text" class="form-control" placeholder="请选择案件"  v-model="register.caseId.caseId"  data-toggle="modal" data-target="#anj"  style="width: 100%">
                </div>
                <div class="col-md-6">
                    <p><b>快递单号：</b></p>
                    <input type="text" class="form-control" placeholder="请输入快递单号" v-model="register.numbers">
                </div>  
            </div>
            <div class="row" style="margin-top: 20px">
                <div class="col-md-6">
                    <p><b>快递费：</b></p>
                    <input type="text" class="form-control" v-model="register.cost" placeholder="请输入快递费">
                </div>
                <div class="col-md-6">
                    <p><b>领件人：</b></p>
                    <div class="input-group">
                        <input type="text" class="form-control" placeholder="请选择领件人"  v-model="register.lempId.empName">
                        <span class="input-group-btn">
                            <button class="btn btn-primary"  data-toggle="modal" data-target="#lempmt"  type="button">选择领件人</button>
                        </span>
                    </div>    
                </div>  
            </div>
            <div class="row" style="margin-top: 20px">
                <div class="col-md-6">
                    <p><b>领件时间：</b></p>
                    <input type="date" class="form-control" v-model="register.drawTime">
                </div>  
            </div>
            <div class="row" style="margin-top: 20px">
                <div class="col-md-12">
                    <p><b>领件说明：</b></p>
                    <input type="text" class="form-control" v-model="register.explainx">
                </div>
            </div>
            <div class="row" style="margin-top: 20px">
                <div class="col-md-12">
                    <p><b>其他备注说明：</b></p>
                    <input type="text" class="form-control" v-model="register.remark">
                </div>
            </div> 
        </div>
        <input type="button" class="btn btn-primary" value="确定提交" @click="postinsert()" >    

         <!-- ------------------------------------------------------------------------- -->
         <!-- 收件人模态框 -->
         <form class="form-inline">
            <div class="modal"  id="empmt" >
                <div class="modal-dialog modal-lg">
                    <div class="modal-content">
                        <div class="modal-header">
                            <span>收件人：</span>
                            <button class="close" data-dismiss="modal">
                                <span>&times;</span>	
                            </button>
                        </div>
                        <div class="modal-body" style="height: 350px">
                            <div class="row" style="margin-left: 25px">
                                <input type="text" class="form-control" v-model="empname" placeholder="请输入姓名">
                                <input type="button" class="btn btn-primary" @click="postempfruyy()" value="检索">
                            </div>

                            <div class="row" style="margin: 15px 25px">
                                <table class="table table-condensed table-hover">
                                    <thead>
                                        <tr>
                                            <th>选择</th>
                                            <th>姓名</th>
                                            <th>手机号</th>
                                            <th>排序</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr v-for="item in emp">
                                            <td><input type="radio" id="ca"  name="radioemp"></td>
                                            <td>{{item.empName}}</td>
                                            <td>{{item.empPhone}}</td>
                                            <td>{{item.empId}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <input type="button" class="btn btn-primary" @click="empconfirm()" value="确定" data-dismiss="modal">
                            <input type="button" class="btn btn-primary" value="关闭" data-dismiss="modal">
                        </div>
                    </div>
                </div>
            </div>
       
            <!-- 模态框 -->
            <div class="modal"  id="anj" >
                    <div class="modal-dialog modal-lg">
                        <div class="modal-content">
                            <div class="modal-header">
                                <span>选择案件</span>
                                <button class="close" data-dismiss="modal">
                                    <span>&times;</span>	
                                </button>
                            </div>
                            <div class="modal-body" style="height: 500px">
                                <div class="row"  style="padding-left: 20px" >
                                    <input type="text" class="form-control" v-model="casetext">
                                    <select class="form-control" v-model="casequery">
                                        <option :value="1">案号搜索</option>
                                        <option :value="2">承办律师搜索</option>
                                        <option :value="3">委托人搜索</option>
                                        <option :value="4">对方当事人搜索</option>
                                        <option :value="5">案由搜索</option>
                                        <option :value="6">受理法院搜索</option>
                                    </select>&nbsp;&nbsp;
                                    <input type="button" class="btn btn-primary" value="搜索"  @click="casequeryc()">
                                </div>
                                
                                <div class="row"  style="padding-left: 20px;margin-top: 30px;" >
                                    <table style="width: 97%;border: none;text-align: center" border="1px" >
                                        <tr style="height: 50px">
                                            <td><b>选择</b></td>
                                            <td><b>案件号</b></td>
                                            <td><b>委托人</b></td>
                                            <td><b>对方当事人</b></td>
                                            <td><b>承办律师</b></td>
                                            <td><b>收案日期</b></td>
                                        </tr>
                                        <tr v-for="item in caselsit" style="height: 50px">
                                        <td><input type="radio"   name="anjian"  ></td>
                                        <td>{{item.caseId}}</td>
                                        <td>{{item.clientId.clientName}}</td>
                                        <td>{{item.oppositeId.clientName}}</td>
                                        <td>{{item.mainLawyer.empName}}</td>
                                        <td>{{item.closeDate}}</td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <input type="button" class="btn btn-primary" @click="submit()" value="确定" data-dismiss="modal">
                                <input type="button" class="btn btn-primary" value="关闭" data-dismiss="modal">
                            </div>
                        </div>
                    </div>
            </div>

            <!-- 领件人 -->
            <div class="modal"  id="lempmt" >
                <div class="modal-dialog modal-lg">
                    <div class="modal-content">
                        <div class="modal-header">
                            <span>领件人：</span>
                            <button class="close" data-dismiss="modal">
                                <span>&times;</span>	
                            </button>
                        </div>
                        <div class="modal-body" style="height: 350px">
                            <div class="row" style="margin-left: 25px">
                                <input type="text" class="form-control" v-model="empname" placeholder="请输入姓名">
                                <input type="button" class="btn btn-primary" @click="postempfruyy()" value="检索">
                            </div>

                            <div class="row" style="margin: 15px 25px">
                                <table class="table table-condensed table-hover">
                                    <thead>
                                        <tr>
                                            <th>选择</th>
                                            <th>姓名</th>
                                            <th>手机号</th>
                                            <th>排序</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr v-for="item in emp">
                                            <td><input type="radio"  name="radiolemp"></td>
                                            <td>{{item.empName}}</td>
                                            <td>{{item.empPhone}}</td>
                                            <td>{{item.empId}}</td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <input type="button" class="btn btn-primary" @click="lempconfirm()" value="确定" data-dismiss="modal">
                            <input type="button" class="btn btn-primary" value="关闭" data-dismiss="modal">
                        </div>
                    </div>
                </div>
            </div>

            <!-- 快递公司 -->
            <div class="modal"  id="mtacompany" style="margin-top: 70px"  >
                    <div class="modal-dialog" style="width: 750px ;height: 100px;">
                        <div class="modal-content">
                            <div class="modal-header">
                                <span>设置管理</span>
                                <button class="close" data-dismiss="modal">
                                    <span>&times;</span>	
                                </button>
                            </div>
                            <div class="modal-body" style="height: 350px">
                                <ul class="nav nav-tabs" role="tablist" style="margin-left: 20px">
                                    <li role="presentation" class="active"><a href="#navregister" aria-controls="navregister" role="tab" data-toggle="tab">列表</a></li>
                                    <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">添加</a></li>
                                </ul>    
                                <div class="tab-content">
                                    <div role="tabpanel" class="tab-pane active" id="navregister">
                                        <div class="row" style="margin-left: 25px;margin-top: 15px">
                                            <input type="text" class="form-control" v-model="companyfu" placeholder="名称">
                                            <input type="button" class="btn btn-primary" @click="companyfurry()" value="检索">
                                        </div>
            
                                        <div class="row" style="margin: 10px 25px">
                                            <table class="table table-condensed table-hover">
                                                <thead>
                                                    <tr>
                                                        <th>选择</th>
                                                        <th>排序</th>
                                                        <th>名称</th>
                                                        <th>删除</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <tr v-for="item in company">
                                                        <td><input type="radio" @click="mtcompany()"  name="radiocompany"></td>
                                                        <td>{{item.companyId}}</td>
                                                        <td>{{item.companyName}}</td>
                                                        <td><input type="button" value="删除" @click="companydelete(item.companyId)" class="btn btn-primary btn-xs" >  </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div role="tabpanel" class="tab-pane" id="profile">
                                        <div class="row"  style="margin-left: 25px;margin-top: 60px">
                                            <div class="col-xs-6">
                                                <label><span style="color: red">*&nbsp;</span>快递公司：</label>
                                                <input type="text" class="form-control" v-model="companyId.companyName" placeholder="输入名称">
                                            </div>
                                            <div class="col-xs-6">
                                                <label><span style="color: red">*&nbsp;</span>序号：</label>
                                                <input type="text" class="form-control" v-model="companyId.sort" placeholder="输入序号">
                                            </div>
                                        </div>
                                        <div  class="row" style="margin-left: 40%;margin-top: 40px">
                                            <input type="button" class="btn btn-primary" @click="companytext()" value="添加">
                                            <input type="button" class="btn btn-default" value="清空" @click="companytest()" style="margin-left: 10px">
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
            </div>
            
            <!-- 快件类型 -->
            <div class="modal"  id="mtespress" style="margin-top: 70px"  >
                    <div class="modal-dialog" style="width: 750px ;height: 100px;">
                        <div class="modal-content">
                            <div class="modal-header">
                                <span>设置管理</span>
                                <button class="close" data-dismiss="modal">
                                    <span>&times;</span>	
                                </button>
                            </div>
                            <div class="modal-body" style="height: 350px">
                                <ul class="nav nav-tabs" role="tablist" style="margin-left: 20px">
                                    <li role="presentation" class="active"><a href="#navregister1" aria-controls="navregister1" role="tab" data-toggle="tab">列表</a></li>
                                    <li role="presentation"><a href="#profile1" aria-controls="profile1" role="tab" data-toggle="tab">添加</a></li>
                                </ul>    
                                <div class="tab-content">
                                    <div role="tabpanel" class="tab-pane active" id="navregister1">
                                        <div class="row" style="margin-left: 25px;margin-top: 15px">
                                            <input type="text" class="form-control" v-model="espressfu" placeholder="名称">
                                            <input type="button" class="btn btn-primary" @click="espressfurry()" value="检索">
                                        </div>

                                        <div class="row" style="margin: 10px 25px">
                                            <table class="table table-condensed table-hover">
                                                <thead>
                                                    <tr>
                                                        <th>选择</th>
                                                        <th>排序</th>
                                                        <th>名称</th>
                                                        <th>删除</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <tr v-for="item in espress">
                                                        <td><input type="radio" @click="mtespress()"  name="radioespress"></td>
                                                        <td>{{item.espressId}}</td>
                                                        <td>{{item.espressName}}</td>
                                                        <td><input type="button" value="删除" @click="espressdelete(item.espressId)" class="btn btn-primary btn-xs" >  </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div role="tabpanel" class="tab-pane" id="profile1">
                                        <div class="row"  style="margin-left: 25px;margin-top: 60px">
                                            <div class="col-xs-6">
                                                <label><span style="color: red">*&nbsp;</span>快件类型：</label>
                                                <input type="text" class="form-control" v-model="espressId.espressName" placeholder="输入名称">
                                            </div>
                                            <div class="col-xs-6">
                                                <label><span style="color: red">*&nbsp;</span>序号：</label>
                                                <input type="text" class="form-control" v-model="espressId.sort" placeholder="输入序号">
                                            </div>
                                        </div>
                                        <div  class="row" style="margin-left: 40%;margin-top: 40px">
                                            <input type="button" class="btn btn-primary" @click="espresstext()" value="添加">
                                            <input type="button" class="btn btn-default" value="清空" @click="espresstest()" style="margin-left: 10px">
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>

        </form>
    </div>
    

    <script>
          var vm=new Vue({
            el:'#app',
            data:{
                register:{
                    registerId:"",
                    empId:{
                        empId:"",
                        empName:""
                    },
                    receipt:"",
                    companyId:{
                        companyId:"",
                        companyName:""
                    },
                    espressId:{
                        espressId:"",
                        espressName:""
                    },
                    state:"-1",
                    caseId:{
                        caseId:""
                    },
                    numbers:"",
                    cost:"",
                    lempId:{
                        empId:"",
                        empName:""
                    },
                    uploading:"",
                    drawTime:"",
                    explainx:"",
                    remark:""
                },
                pd:"1",
                emp:[],
                company:[],
                espress:[],
                empname:"",
                casetext:"",   //案件模态框
                casequery:"1",  //案件模态框的模糊查询
                caselsit:[],
                companyfu:"",        
                companyId:{      //快递公司添加   
                    companyId:"",
                    sort:"",
                    companyName:""
                },
                espressfu:"",
                espressId:{
                    espressId:"",
                    sort:"",
                    espressName:""
                }  
            },
            methods: {
                posthremp(){   //收件人获取
                    this.$http.post('http://localhost:8080/register/empinfo',{},{emulateJSON:true}).then(result =>{
                        var dat=eval("("+result.body+")")
                        if(dat!=null&&dat!=""){
                            this.emp=new Array()   //每次重新new一个list集合给定义的list集合
                            for(var i=0;i<dat.length;i++){
                                this.emp.push(dat[i])
                            }
                        }else{
                            alert("获取失败")
                        }
                    })
                },
                postempfruyy(){ //收件人获取模糊查询
                    this.$http.post('http://localhost:8080/register/empfruyy',{'empname':this.empname},{emulateJSON:true}).then(result =>{
                        var dat=eval("("+result.body+")")
                        this.emp=new Array()   //每次重新new一个list集合给定义的list集合
                        for(var i=0;i<dat.length;i++){
                            this.emp.push(dat[i])
                        }
                    })
                },
                empconfirm(){  //收件人模态框确定按钮
                    var sv=$("input[name='radioemp']")
                    for(var i = 0;i<sv.length; i++){
                        if(sv[i].checked==true){
                            var c=$(sv[i]).parent().parent().find("td").eq(1).text();
                            this.register.empId.empName=c
                            var cd=$(sv[i]).parent().parent().find("td").eq(3).text();
                            this.register.empId.empId=cd
                        }
                    }
                },
                 lempconfirm(){  //领件人模态框确定按钮
                    var sv=$("input[name='radiolemp']")
                    for(var i = 0;i<sv.length; i++){
                        if(sv[i].checked==true){
                            var c=$(sv[i]).parent().parent().find("td").eq(1).text();
                            this.register.lempId.empName=c
                            var cd=$(sv[i]).parent().parent().find("td").eq(3).text();
                            this.register.lempId.empId=cd
                        }
                    }
                },
                postcompany(){  //快递公司查询
                    this.$http.post('http://localhost:8080/register/company',{},{emulateJSON:true}).then(result =>{
                        var dat=eval("("+result.body+")")
                        if(dat!=null&&dat!=""){
                            this.company=new Array()   //每次重新new一个list集合给定义的list集合
                            for(var i=0;i<dat.length;i++){
                                this.company.push(dat[i])
                            }
                        }else{
                            alert("获取失败")
                        }
                    })
                },
                postespress(){  //快件类型查询
                    this.$http.post('http://localhost:8080/register/espress',{},{emulateJSON:true}).then(result =>{
                        var dat=eval("("+result.body+")")
                        if(dat!=null&&dat!=""){
                            this.espress=new Array()   //每次重新new一个list集合给定义的list集合
                            for(var i=0;i<dat.length;i++){
                                this.espress.push(dat[i])
                            }
                        }else{
                            alert("获取失败")
                        }
                    })
                },
                //案件模态框
                casequeryc(){
                    this.$http.post('http:localhost:8080/log_table/casequery',{"casetext":this.casetext,"casequery":this.casequery},{emulateJSON:true}).then(result =>{
                        var dat=eval("("+result.body+")")
                        if(dat!=null&&dat!=""){
                            this.caselsit=new Array()   //每次重新new一个list集合给定义的list集合
                        for(var i=0;i<dat.length;i++){
                            this.caselsit.push(dat[i])
                        }
                        }else{
                            alert("获取失败")
                        }
                    })
                },
                submit(){
                    var sv=$("input[name='anjian']")
                    for(var i = 0;i<sv.length; i++){
                        if(sv[i].checked==true){
                            var c=$(sv[i]).parent().parent().find("td").eq(1).text();
                            this.register.caseId.caseId=c
                        }
                    }
                },
                postcase(){
                    this.$http.post("http://localhost:8080/log_table/caselist",{},{emulateJSON:true}).then(result =>{
                        var dat=eval("("+result.body+")")
                        if(dat!=null&&dat!=""){
                            this.caselsit=new Array()   //每次重新new一个list集合给定义的list集合
                        for(var i=0;i<dat.length;i++){
                            this.caselsit.push(dat[i])
                        }
                        }else{
                            alert("获取失败")
                        }
                    })
                },
                //点击开启其他
                opone(){
                    if(this.pd=='1'){
                        $("#opone").css("display","inline")
                        this.pd='2'
                    }else{
                        $("#opone").css("display","none")
                        this.pd='1'
                    }
                   
                },
                mtcompany(){   //快递公司模态框
                    var sv=$("input[name='radiocompany']")
                    for(var i = 0;i<sv.length; i++){
                        if(sv[i].checked==true){
                            var c=$(sv[i]).parent().parent().find("td").eq(1).text();
                            this.register.companyId.companyId=c
                            var cb=$(sv[i]).parent().parent().find("td").eq(2).text();
                            this.register.companyId.companyName=cb
                            $("#mtacompany").modal('hide');  //手动关闭
                        }
                    }
                },
                mtespress(){   //快件类型模态框
                    var sv=$("input[name='radioespress']")
                    for(var i = 0;i<sv.length; i++){
                        if(sv[i].checked==true){
                            var c=$(sv[i]).parent().parent().find("td").eq(1).text();
                            this.register.espressId.espressId=c
                            var cb=$(sv[i]).parent().parent().find("td").eq(2).text();
                            this.register.espressId.espressName=cb
                            $("#mtespress").modal('hide');  //手动关闭
                        }
                    }
                },
                companyfurry(){ //快递公司模态框中的模糊查询
                    this.$http.post('http://localhost:8080/register/companyfurry',{"companyfu":this.companyfu},{emulateJSON:true}).then(result =>{
                        var dat=eval("("+result.body+")")
                        this.company=new Array()   //每次重新new一个list集合给定义的list集合
                        for(var i=0;i<dat.length;i++){
                            this.company.push(dat[i])
                        }
                    })
                },
                espressfurry(){ //快递公司模态框中的模糊查询
                    this.$http.post('http://localhost:8080/register/espressfurry',{"espressfu":this.espressfu},{emulateJSON:true}).then(result =>{
                        var dat=eval("("+result.body+")")
                        this.espress=new Array()   //每次重新new一个list集合给定义的list集合
                        for(var i=0;i<dat.length;i++){
                            this.espress.push(dat[i])
                        }
                    })
                },
                companytext(){      //添加
                    var jsons=JSON.stringify(this.companyId)
                    this.$http.post('http://localhost:8080/register/companyinsert',{"data":jsons},{emulateJSON:true}).then(result =>{
                        if(result.body=="1"){
                            this.open1();
                            this.postcompany();
                        }
                    })
                },
                espresstext(){      //添加
                    var jsons=JSON.stringify(this.espressId)
                    this.$http.post('http://localhost:8080/register/espressinsert',{"data":jsons},{emulateJSON:true}).then(result =>{
                        if(result.body=="1"){
                            this.open1();
                            this.postespress();
                        }
                    })
                },
                companytest(){  //清空
                    this.companyId.companyName='';
                    this.companyId.sort='';
                },
                espresstest(){  //清空
                    this.espressId.espressName='';
                    this.espressId.sort='';
                },
                companydelete(id){  //快递公司删除
                    this.$http.post('http://localhost:8080/register/companydelete',{"id":id},{emulateJSON:true}).then(result =>{
                        if(result.body=='1'){
                            this.open2()
                            this.postcompany();
                        }
                    })
                }, 
                espressdelete(id){  //快件类型删除
                    this.$http.post('http://localhost:8080/register/espressdelete',{"id":id},{emulateJSON:true}).then(result =>{
                        if(result.body=='1'){
                            this.open2()
                            this.postespress();
                        }
                    })
                },
                postinsert(){
                    if(this.register.empId.empId==""||this.register.empId.empId==null){
                        this.open3()
                    }else if(this.register.receipt==null||this.register.receipt==""){
                        this.open4()
                    }else if(this.register.companyId.companyId==""||this.register.companyId.companyId==null){
                        this.open5()
                    }else if(this.register.espressId.espressId==""||this.register.espressId.espressId==null){
                        this.open6()
                    }else if(this.register.state=="-1"){
                        this.open7()
                    }else{
                        var jsons=JSON.stringify(this.register)
                        this.$http.post('http://localhost:8080/register/registerinsert',{"data":jsons},{emulateJSON:true}).then(result =>{
                            if(result.body=="1"){
                                this.open()
                            }
                        })
                     }
                },
                open() {
                    this.$alert('添加成功', '提示消息', {
                    confirmButtonText: '确定',
                    callback: action =>{
                        location.href="admRegister.html"
                    }
                 })
                },
                open1() {
                    this.$message({
                        showClose: true,
                        message: '添加成功',
                        type: 'success'
                    });
                },
                open2() {
                    this.$message({
                        showClose: true,
                        message: '删除成功',
                        type: 'success'
                    });
                },
                open3() {
                    this.$message({
                        showClose: true,
                        message: '收件人不能为空',
                        type: 'error'
                    });
                },
                open4() {
                    this.$message({
                        showClose: true,
                        message: '收件日期不能为空',
                        type: 'error'
                    });
                },
                open5() {
                    this.$message({
                        showClose: true,
                        message: '快递公司不能为空',
                        type: 'error'
                    });
                },
                open6() {
                    this.$message({
                        showClose: true,
                        message: '快件类型不可为空',
                        type: 'error'
                    });
                }, 
                open7() {
                    this.$message({
                        showClose: true,
                        message: '领件状态必填',
                        type: 'error'
                    });
                }
           
            },
            created () {
                var id = getUrlParam("id")
                this.posthremp()
                this.postcompany()
                this.postespress()
                this.postcase()
            }
        })      
    </script>

</body>
</html>